#ifndef PROFILEMANAGER_H
#define PROFILEMANAGER_H


#include <map>
#include <string>
#include <vector>

using namespace std;


static const char RDT_PARAM_SERVER         = ' ';
static const char RDT_PARAM_DOMAIN         = 'd';
static const char RDT_PARAM_USER_NAME      = 'u';
static const char RDT_PARAM_PASSWORD       = 'p';
static const char RDT_PARAM_ATTACH_CONSOLE = '0';


typedef vector<string> Profiles;
typedef map<char, string> Arguments;
typedef map<string, string> Configration;


class ProfileManager
{
    public:

        ProfileManager(const string& strConfigFile);

        virtual bool setConfigration(Configration& configration);

        virtual Profiles getProfiles() = 0;
        virtual bool setProfile(string& strProfileName, Arguments& arguments) = 0;

        virtual Arguments getArguments(string& strProfileName) = 0;

        static string getCommandLine(Arguments& arguments);
        static bool writeFile(const string& strFilePath, const string& strText);

    protected:

        static const string RDT_CMD;
        static const string CONFIG_PROFILE_DIR;

        Configration configration;

    private:

        string strConfigFile;
};


void ReplaceAll(string& str1, string strPattern, string str2);

vector<string> split(const string& str, const string& delims = ",; \t");

#endif
